# include <iostream>
using namespace std;

typedef struct node
{
    int value;
    struct node *next;
}node;

node *createlist(int num)
{
    node *head = new node;
    node *pre = head;
    for(int i=0; i< num; i++)
    {
        node *p = new node;
        cout << "please input  a number:";
        cin >> p->value;
        p -> next = NULL;
        pre->next = p;
        pre = p;  
    }
    return head;
}

void showlist(node *head)
{
    node *p = head->next;
    while(p != NULL)
    {
        cout << "value is :" << p->value << endl;
        p = p->next;

    }
}

int main()
{
    node *kk;
    kk = createlist(5);
    showlist(kk);
    return 0;
}